import request from '@/utils/request';
import {ElMessage} from 'element-plus';


/**
 * 用人单位登录
 */
export async function login(data) {
    const res = await request.post('/login', data);
    if (res.data.code === 200) {
        setToken('Bearer ' + res.data.token, data.remember);
        return res.data.msg;
    }
    return Promise.reject(new Error(res.data.msg));
}

